package com.bw.repair.adapter

import android.view.View
import android.widget.ImageView
import com.bw.image.GlideImageLoader
import com.bw.repair.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Author :
 * Created by lhy on 2025/5/11.
 * Description:
 */
class ImageAdapter:BaseQuickAdapter<String,BaseViewHolder>(R.layout.item_repair_img) {
    override fun convert(holder: BaseViewHolder, item: String) {
        val iv_faultPhotos = holder.getView<ImageView>(R.id.iv_faultPhotos)
        val iv_add = holder.getView<ImageView>(R.id.iv_add)
        GlideImageLoader.loadImage(context,item,iv_faultPhotos)
        if(item=="初始"){
            iv_add.visibility = View.VISIBLE
            iv_faultPhotos.visibility = View.INVISIBLE
        }else{
            iv_add.visibility = View.INVISIBLE
            iv_faultPhotos.visibility = View.VISIBLE
        }
    }
}